import request from '@/utils/request'

export function getUserTodoTask(params) {
  return request({
    url: '/task/userTodoTask',
    method: 'get',
    params,
  })
}

export function getUserDoneTask(params) {
  return request({
    url: '/task/userDoneTask',
    method: 'get',
    params,
  })
}

export function getTaskHistory(params) {
  return request({
    url: '/task/taskHistory',
    method: 'get',
    params,
  })
}

export function doCompleteTask(data) {
  return request({
    url: '/task/completeTask',
    method: 'put',
    data,
  })
}

export function doRejectTaskToFirst(data) {
  return request({
    url: '/task/rejectTaskToFirst',
    method: 'put',
    data,
  })
}

export function doRejectTaskToParent(data) {
  return request({
    url: '/task/rejectTaskToParent',
    method: 'put',
    data,
  })
}

export function doRejectTaskToAny(data) {
  return request({
    url: '/task/rejectTaskToAny',
    method: 'put',
    data,
  })
}

export function getTaskFlowData(params) {
  return request({
    url: '/task/flowData',
    method: 'get',
    params,
  })
}
